//
//  GetAdvertisingImageEngine.m
//  HuLaQuan
//
//  Created by liyan on 16/1/27.
//  Copyright © 2016年 yuwubao. All rights reserved.
//

#import "GetAdvertisingImageEngine.h"

@implementation GetAdvertisingImageEngine

-(void)getAdverttisingImage:(NSString *)userID
{
    NSString *src = [NSString stringWithFormat: @"<?xml version=\"1.0\" encoding=\"UTF-8\"?><msg service=\"AdvertisingImages\" userId=\"%@\"></msg>",userID];
    //
    NSLog(@"%@ -- src --- ",src);
    
    //use Yu
    [YuHTTPClient XMLFMDataWithUrl:FM_SERVER_HOST parameters:src success:^(BOOL isSuccess, id item){
        
        NSDictionary *result;
        if (isSuccess) {
            result = @{@"isSuccess":@YES,@"result":item};
        }else{
            result = @{@"isSuccess":@NO,@"message":item};
        }
        //
        [[NSNotificationCenter defaultCenter] postNotificationName:@"GetADImageFinish" object:result];
    }];
}
@end
